drop table if exists t1;
create table t1 (a int primary key, b int);
begin;
alter table t1 modify b bigint;
-- @session:id=1{
use `prepare`;
prepare stmt1 from select * from t1 where a > ? for update;
set @a=1;
-- @wait:0:commit
execute stmt1 using @a;
-- @session}
commit;


DROP TABLE IF EXISTS `t_mes_product`;
CREATE TABLE `t_mes_product` (
`id` BIGINT NOT NULL,
`tenant_id` VARCHAR(50) NOT NULL COMMENT '租户ID',
`code` VARCHAR(50) DEFAULT null COMMENT '产品编码',
`name` VARCHAR(50) DEFAULT null COMMENT '产品名称',
`version` VARCHAR(50) DEFAULT null COMMENT '版本',
`description` VARCHAR(255) DEFAULT null COMMENT '描述',
`material_code` VARCHAR(50) DEFAULT null COMMENT '物料编码',
`material_name` VARCHAR(50) DEFAULT null COMMENT '物料名称',
`ean` VARCHAR(50) DEFAULT null COMMENT '商品编码',
`product_family` BIGINT DEFAULT null COMMENT '产品系列，',
`product_type` BIGINT DEFAULT null COMMENT '产品类型，原材料、半成品、成品',
`segments` VARCHAR(50) DEFAULT null COMMENT '产品所属工段',
`sided_process` VARCHAR(50) DEFAULT null COMMENT '单面制程，双面制程',
`remark` VARCHAR(500) DEFAULT null COMMENT '备注',
`create_org` BIGINT DEFAULT null COMMENT '创建组织',
`use_org` BIGINT DEFAULT null COMMENT '使用组织',
`create_time` DATETIME NOT NULL COMMENT '创建时间',
`create_user` BIGINT DEFAULT null COMMENT '创建人员',
`create_user_name` VARCHAR(50) DEFAULT null COMMENT '创建用户名称',
`create_dept` BIGINT DEFAULT null COMMENT '创建部门',
`update_time` DATETIME DEFAULT null COMMENT '更新时间',
`update_user` BIGINT DEFAULT null COMMENT '更新人员',
`update_user_name` VARCHAR(50) DEFAULT null COMMENT '修改用户名称',
`status` INT DEFAULT null,
`is_deleted` INT DEFAULT null COMMENT '是否已删除',
`board_qty` DECIMAL(20,2) DEFAULT null,
PRIMARY KEY (`id`)
) COMMENT='产品';
INSERT INTO `t_mes_product` VALUES (1656515790333313025,'000000','920000537','倒车摄像头,MEH-3776100D','v1','','','','455',1656514619401076737,1656515583327633409,'1712376839028228097,1716651767777783809','B','',1613449915397328898,1613449915397328898,'2023-05-11 12:25:16',1123598821738675201,NULL,1529468143136727042,'2023-12-22 12:32:44',1123598821738675201,'admin',1,1,NULL),(1738046955855589377,'000000','7009A2109L-B02','Alarm  USB','1','','','','7009A2109L-B02',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:01:00',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:46',1735505468047536130,'zhangbo',1,0,NULL),(1738051816496082946,'000000','7009A2109L-B03','Alarm  AC','1','','','','7009A2109L-B03',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:20:19',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:39',1735505468047536130,'zhangbo',1,0,NULL),(1738051996612079617,'000000','7009A1913L-A01','WALL board','1','','','','7009A1913L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:21:02',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:32',1735505468047536130,'zhangbo',1,0,NULL),(1738052116539813890,'000000','7007A1914L-A01','IO-board','1','','','','7007A1914L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:21:31',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:26',1735505468047536130,'zhangbo',1,0,NULL),(1738052276942581761,'000000','7006A1914L-A02','IR1914','1','','','','7006A1914L-A02',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:22:09',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:21',1735505468047536130,'zhangbo',1,0,NULL),(1738052441594179585,'000000','7009A1914L-A04','Sensor/M2S','1','','','','7009A1914L-A04',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:22:48',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:14:11',1735505468047536130,'zhangbo',1,0,NULL),(1738052649061232641,'000000','7006A1914L-A01','LED board','1','','','','7006A1914L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:23:38',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:58',1735505468047536130,'zhangbo',1,0,NULL),(1738052869333495809,'000000','7009A1914L-A03','FPC-MIC','1','','','','7009A1914L-A03',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:24:30',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:36',1735505468047536130,'zhangbo',1,0,NULL),(1738053040226217986,'000000','7009A1914L-A02','POGO-board','1','','','','7009A1914L-A02',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:25:11',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:30',1735505468047536130,'zhangbo',1,0,NULL),(1738053232715411458,'000000','7009A1913L-A02','Button-board','1','','','','7009A1913L-A02',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:25:57',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:25',1735505468047536130,'zhangbo',1,0,NULL),(1738053369739128834,'000000','7009A2211L-B05','Main to IO','1','','','','7009A2211L-B05',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:26:29',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:20',1735505468047536130,'zhangbo',1,0,NULL),(1738053608948674561,'000000','7009A2211L-C01','Button2211','1','','','','7009A2211L-C01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:27:27',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:15',1735505468047536130,'zhangbo',1,0,NULL),(1738053835801800706,'000000','7009A2217L-A01','ALS-Board','1','','','','7009A2217L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:28:21',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:10',1735505468047536130,'zhangbo',1,0,NULL),(1738054016370782210,'000000','7006A2209L-A01','IR2209','1','','','','7006A2209L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:29:04',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:13:04',1735505468047536130,'zhangbo',1,0,NULL),(1738054129294028801,'000000','7006A2217L-A01','IR2217','1','','','','7006A2217L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:29:31',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:12:51',1735505468047536130,'zhangbo',1,0,NULL),(1738054245157482497,'000000','7001A2119L-D03','2119MB','1','','','','7001A2119L-D03',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:29:58',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:55',1735505468047536130,'zhangbo',1,0,NULL),(1738054467623366658,'000000','7005A2307L-A01','FPC-Battery','1','','','','7005A2307L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:30:51',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:46',1735505468047536130,'zhangbo',1,0,NULL),(1738054621764038657,'000000','7007A2102L-A01','FPC-2102-USB','1','','','','7007A2102L-A01',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:31:28',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:12:17',1735505468047536130,'zhangbo',1,0,NULL),(1738054761614716929,'000000','7009A2102L-A02','FPC-2102-LCD','1','','','','7009A2102L-A02',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:32:01',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:32',1735505468047536130,'zhangbo',1,0,NULL),(1738054886663696385,'000000','7009A2102L-A03','FPC-2102-GPS','1','','','','7009A2102L-A03',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:32:31',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:25',1735505468047536130,'zhangbo',1,0,NULL),(1738055003969990658,'000000','7009A2102L-A04','FPC-2102-JUMPER','1','','','','7009A2102L-A04',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:32:59',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:19',1735505468047536130,'zhangbo',1,0,NULL),(1738055184648024065,'000000','7009A2102L-A05','FPC-2102-MODE','1','','','','7009A2102L-A05',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:33:42',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:13',1735505468047536130,'zhangbo',1,0,NULL),(1738055309621506049,'000000','7009A2102L-A06','FPC-2102-MIC','1','','','','7009A2102L-A06',1738078210122887170,1656515583327633409,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:34:12',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 14:11:07',1735505468047536130,'zhangbo',1,0,NULL),(1738061294301917186,'000000','A1','A1','1','','','','1',1738061108389392385,1656515486455988226,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:57:59',1123598821738675201,'admin',1529468143136727042,'2023-12-22 14:17:23',1123598821738675201,'admin',1,1,NULL),(1738061718744510466,'000000','A2','A2','2','','','','A2',1738061108389392385,1656515486455988226,'1712376839028228097',NULL,'',1663850099010822145,1663850099010822145,'2023-12-22 12:59:40',1123598821738675201,'admin',1529468143136727042,'2023-12-22 14:17:27',1123598821738675201,'admin',1,1,NULL),(1738091248059781122,'000000','T90001-00013','GRP2602P','V1.7','','','','T90001-00013',1738084161756377089,1656515463169212418,'1716651767777783809',NULL,'IP PHONE,GRP2602P_V1.7  PRODUCTION 潮流',1663850099010822145,1663850099010822145,'2023-12-22 14:57:00',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:17:33',1735505468047536130,'zhangbo',1,0,NULL),(1738091678651224066,'000000','T90001-00022','GWN7001','V1.0','','','','T90001-00022',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'ROUTER,GWN7001_V1.0  BIS（印度规）  PRODUCTION 潮流',1663850099010822145,1663850099010822145,'2023-12-22 14:58:43',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:17:13',1735505468047536130,'zhangbo',1,0,NULL),(1738091814391484417,'000000','T90001-00030','GWN7602','V2.1','','','','T90001-00030',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7602(WORLD)_V2.1 PRODUCTION 潮流',1663850099010822145,1663850099010822145,'2023-12-22 14:59:15',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:16:49',1735505468047536130,'zhangbo',1,0,NULL),(1738092023481733122,'000000','T90001-00002','GWN7605','V2.1','','','','T90001-00002',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7605(WORLD)_V2.1 PRODUCTION(TAITIEN CRYSTAL+MP8004) 潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:00:05',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:16:10',1735505468047536130,'zhangbo',1,0,NULL),(1738092348020199426,'000000','T90001-00017','GWN7605LR','V2.0','','','','T90001-00017',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7605LR(WORLD)_V2.0 PRODUCTION(MT7621D+MT7615D+MP8004  潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:01:23',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:15:29',1735505468047536130,'zhangbo',1,0,NULL),(1738092520443842561,'000000','T90001-00018','GWN7615','V2.1','','','','T90001-00018',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7615(WORLD)_V2.1 PRODUCTION(TAITIEN CRYSTAL+MP8004)  潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:02:04',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:14:41',1735505468047536130,'zhangbo',1,0,NULL),(1738092627662835713,'000000','T90001-00008','GWN7630','V2.1','','','','T90001-00008',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7630(WORLD)_V2.1 PRODUCTION(TAITIEN CRYSTAL+MP8009  SKD 潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:02:29',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:14:08',1735505468047536130,'zhangbo',1,0,NULL),(1738092737876561922,'000000','T90001-00021','GWN7630LR','V2.1','','','','T90001-00021',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7630LR(WORLD)_V2.1 PRODUCTION(TAITIEN CRYSTAL+MP8009)  潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:02:56',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:13:48',1735505468047536130,'zhangbo',1,0,NULL),(1738092859381354498,'000000','T90001-00010','GWN7660','V2.1A','','','','T90001-00010',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7660 (WORLD)_V2.1A PRODUCTION(POE+SY5605+KX FEM)  SKD 潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:03:25',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:13:25',1735505468047536130,'zhangbo',1,0,NULL),(1738092995587182594,'000000','T90001-00012','GWN7664','V1.3','','','','T90001-00012',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7664(WORLD)_V1.3(KX FEM) PRODUCTION  潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:03:57',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:12:56',1735505468047536130,'zhangbo',1,0,NULL),(1738093095092850690,'000000','T90001-00014','GWN7664LR','V1.2','','','','T90001-00014',1738083167974764546,1656515463169212418,'1716651767777783809',NULL,'AP,GWN7664LR(WORLD)_V1.2 PRODUCTION SKD 潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:04:21',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 15:43:26',1735505468047536130,'zhangbo',1,0,NULL),(1738093390904528897,'000000','T90001-00026','GWN7700','V1.5','','','','T90001-00026',1738084057142046722,1656515463169212418,'1716651767777783809',NULL,'UM,5PORTS GE ETHERNET SWITCH,GWN7700_V1.5(EN8850DHE)  BIS 印度规 PRODUCTION',1663850099010822145,1663850099010822145,'2023-12-22 15:05:31',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:11:06',1735505468047536130,'zhangbo',1,0,NULL),(1738093581539840002,'000000','T90001-00029','GWN7700P','V1.5','','','','T90001-00029',1738084057142046722,1656515463169212418,'1716651767777783809',NULL,'UM,5PORTS PoE GE ETHERNET SWITCH,GWN7700P_V1.5(EN8850DHE) BIS 印度规 PRODUCTION',1663850099010822145,1663850099010822145,'2023-12-22 15:06:17',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:10:43',1735505468047536130,'zhangbo',1,0,NULL),(1738093793914228737,'000000','T90001-00032','GWN7701','V1.0','','','','T90001-00032',1738084057142046722,1656515463169212418,'1716651767777783809',NULL,'UM,8PORTS GE ETHERNET SWITCH,GWN7701_V1.0 BIS PRODUCTION',1663850099010822145,1663850099010822145,'2023-12-22 15:07:07',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:10:16',1735505468047536130,'zhangbo',1,0,NULL),(1738093938286366721,'000000','T90001-00034','GWN7701P','V1.0','','','','T90001-00034',1738084057142046722,1656515463169212418,'1716651767777783809',NULL,'UM,8PORTS PoE GE ETHERNET SWITCH,GWN7701P_V1.0 BIS   PRODUCTION',1663850099010822145,1663850099010822145,'2023-12-22 15:07:42',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 17:09:46',1735505468047536130,'zhangbo',1,0,NULL),(1738094138132369409,'000000','T90001-00006','UCM6301','V1.3','','','','T90001-00006',1738084057142046722,1656515463169212418,'1716651767777783809',NULL,'UCM6301_V1.3  BIS  PRODUCTION--SKD 潮流',1663850099010822145,1663850099010822145,'2023-12-22 15:08:29',1735505468047536130,'zhangbo',1735505342971822082,'2023-12-22 15:32:18',1735505468047536130,'zhangbo',1,0,NULL);
SELECT COUNT(*) AS total FROM t_mes_product WHERE is_deleted = 0 AND (code LIKE '%7009A2109L-B03%' OR id = ?);
DROP TABLE IF EXISTS `t_mes_product`;
DROP TABLE IF EXISTS `t_mes_product_bom`;
CREATE TABLE `t_mes_product_bom` (
`a_id` int(10)
);
INSERT INTO `t_mes_product_bom` VALUES (?);
DROP TABLE IF EXISTS `t_mes_product_bom`;
drop table if exists t1;
create table t1 (a int primary key, b int);
begin;
alter table t1 alter column b drop default;
-- @session:id=1{
use prepare;
prepare s1 from insert into t1 values (?, 2);
set @a=1;
-- @wait:0:commit
execute s1 using @a;
select * from t1;
-- @session}
commit;

delete from t1;
insert into t1 values (1,1);
prepare s1 from insert into t1 values (?,1) on duplicate key update b = ?;
set @a=1;
set @b=10;
execute s1 using @a, @b;
select * from t1;